/**
 * @file STL_MysqlConnection.h
 * @author Derek Liu (yjkhtddx@sina.com)
 * @brief 
 * @version 0.1
 * @date 2020-10-14
 * 
 * @copyright Copyright Sci-Tech Laboratories (c) 2020
 * 
 */

#ifndef _STL_MYSQL_CONNECTION_H_
#define _STL_MYSQL_CONNECTION_H_

#include <mysql/mysql.h>
#include <string>
#include "STL_MysqlQueryResult.h"

namespace STL
{
    class STL_MysqlConnection
    {
    public:
        STL_MysqlConnection(std::string host, unsigned int prot, std::string user, std::string passwd, std::string database);
        virtual ~STL_MysqlConnection();

        STL_MysqlQueryResult executeQuery(std::string statement, long tid, bool log = false);
        void charset(const std::string &cs);

    private:
        // MYSQL代表了一条TCP连接
        MYSQL *conn;
    };

    class STL_MysqlSome
    {
    public:
        STL_MysqlSome() {}
        STL_MysqlConnection *first;
        bool second;
    };
}

#endif //_STL_MYSQL_CONNECTION_H_